import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * Created with IntelliJ IDEA.
 * Description: 针对字节流的写操作
 */
public class FileTest9 {
    public static void main(String[] args) {
        // 每次按照写操作打开文件，都会清空原有文件的内容
        try(OutputStream outputStream = new FileOutputStream("d:/test.txt")) {
            byte[] buffer = new byte[]{97, 98, 99};
            outputStream.write(buffer);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
